import 'package:boss/ui/widget/center_title_app_bar.dart';
import 'package:flutter/material.dart';
import 'package:hi_common/hi_common.dart';
import 'package:provider/provider.dart';
import 'package:router/annotation.dart';

import 'provider/binding_commodity_provider.dart';
import 'widget/binding_commodity_browser.dart';

@RouterConfig(BindingCommodityPage.pageName)
class BindingCommodityPage extends StatefulWidget {
  static const String pageName = '/bindingCommodityPage';

  @override
  _BindingCommodityPageState createState() => _BindingCommodityPageState('关联菜品');
}

class _BindingCommodityPageState extends BaseState<BindingCommodityPage> {
  _BindingCommodityPageState(String pageName) : super(pageName);

  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider(
      create: (_) => BindingCommodityProvider(),
      child: Scaffold(
        appBar: CenterTitleAppBar(
          title: super.pageName,
        ),
        body: BindingCommodityBrowser(),
      ),
    );
  }
}
